www.gusucode.com > 地方成人教育中心整站源代码 1 > 地方成人教育中心整站源代码 1.0/manage/Function/Function_Admin.asp
<% action=Request.QueryString ("Action") Select Case Lcase(action) Case "delall" Call dell_colume() Case "add" Call add_colume() Case "update" Call update_colume() End Select Sub dell_colume ID=trim(request("chk")) If ID="" Then response.write"<script language=javascript>alert('没有选择数据');history.go(-1);</script>":response.End sql="delete from Idea_Admin where ID in("&ID&")" Call idea.exec("",-1) set rs = server.createobject("adodb.recordset") conn.execute(sql) set rs=nothing response.write "<script language=javascript>alert('数据删除成功');location.href='Admin_Admin.asp';</script>" End Sub Sub add_colume UserName=trim(request("UserName")) Password=md5(trim(request("Password"))) AdminPower=trim(request("P11"))&trim(request("P12"))&trim(request("P21"))&trim(request("P22"))&trim(request("P23"))&_ trim(request("P2101"))&trim(request("P2201"))&trim(request("P2301"))&_ trim(request("P2102"))&trim(request("P2202"))&trim(request("P2302"))&_ trim(request("P2103"))&trim(request("P2203"))&trim(request("P2303"))&_ trim(request("P2104"))&trim(request("P2204"))&trim(request("P2304"))&_ trim(request("P2105"))&trim(request("P2205"))&trim(request("P2305"))&_ trim(request("P2106"))&trim(request("P2206"))&trim(request("P2306"))&_ trim(request("P31"))&trim(request("P32"))&trim(request("P41"))&trim(request("P42"))&trim(request("P43"))&_ trim(request("P51"))&trim(request("P52"))&trim(request("P53"))&trim(request("P61"))&trim(request("P62"))&_ trim(request("P71"))&trim(request("P72"))&trim(request("P81"))&trim(request("P91"))&trim(request("P92"))&_ trim(request("P01"))&trim(request("P02"))&trim(request("P03"))&trim(request("P04"))&trim(request("P05"))&_ trim(request("P06"))&trim(request("P101"))&trim(request("P102"))&trim(request("P103")) if(trim(request("Working"))<>"") then Working=1 else Working=0 end if sql="insert into Idea_Admin([UserName],[Password],[AdminPower],[Working]) values('"&UserName&"','"&Password&"','"&AdminPower&"','"&Working&"')" Call idea.exec("",-1) set rs = server.createobject("adodb.recordset") conn.execute(sql) set rs=nothing response.write "<script language=javascript>alert('数据添加成功');location.href='Admin_Admin.asp';</script>" End Sub Sub update_colume ID=trim(request("ID")) Password=md5(trim(request("Password"))) AdminPower=trim(request("P11"))&trim(request("P12"))&trim(request("P21"))&trim(request("P22"))&trim(request("P23"))&_ trim(request("P2101"))&trim(request("P2201"))&trim(request("P2301"))&_ trim(request("P2102"))&trim(request("P2202"))&trim(request("P2302"))&_ trim(request("P2103"))&trim(request("P2203"))&trim(request("P2303"))&_ trim(request("P2104"))&trim(request("P2204"))&trim(request("P2304"))&_ trim(request("P2105"))&trim(request("P2205"))&trim(request("P2305"))&_ trim(request("P2106"))&trim(request("P2206"))&trim(request("P2306"))&_ trim(request("P31"))&trim(request("P32"))&trim(request("P41"))&trim(request("P42"))&trim(request("P43"))&_ trim(request("P51"))&trim(request("P52"))&trim(request("P53"))&trim(request("P61"))&trim(request("P62"))&_ trim(request("P71"))&trim(request("P72"))&trim(request("P81"))&trim(request("P91"))&trim(request("P92"))&_ trim(request("P01"))&trim(request("P02"))&trim(request("P03"))&trim(request("P04"))&trim(request("P05"))&_ trim(request("P06"))&trim(request("P101"))&trim(request("P102"))&trim(request("P103")) if(trim(request("Working"))<>"") then Working=1 else Working=0 end if if trim(request("Password"))="" then sql="update Idea_Admin set [AdminPower]='"&AdminPower&"',[Working]='"&Working&"' where ID="&ID&"" else sql="update Idea_Admin set [Password]='"&Password&"',[AdminPower]='"&AdminPower&"',[Working]='"&Working&"' where ID="&ID&"" end if Call idea.exec("",-1) set rs = server.createobject("adodb.recordset") conn.execute(sql) set rs=nothing response.write "<script language=javascript>alert('数据更新成功');location.href='Admin_Admin.asp';</script>" End Sub Function Inf_Count() sql="select * from Idea_Admin" set rs=idea.exec(sql,1) Inf_Count=rs.recordcount rs.close set rs=nothing End Function %>